<?php if($pagerInfo['totalPages'] > 1): ?>
<div style="text-align:center; padding-bottom:5px; margin-bottom:5px;">
	<div class="pager">
		<div>
			<?php if ($pagerInfo['prevUrl']): ?> <a class="btn" href="<?php echo $page_url.$pagerInfo['prevUrl'];?>">Назад</a><?php endif;?>
			<?php if($pagerInfo['totalPages'] < _cfg('mob_pager')+2):?>
				<?php for($i=1;$i<=$pagerInfo['totalPages'];$i++):?>
					<?php if($i != $pagerInfo['current']):?>
						<a class="btn" href="<?=$page_url.$i;?>"><?=$i;?></a>
					<?php else:?>
						<span class="mob_selected"><?=$i;?></span>
					<?php endif;?>
				<?php endfor;?>
			<?php elseif($pagerInfo['current'] <= round(_cfg('mob_pager')/2+1)):?>
				<?php for($i=1;$i <= _cfg('mob_pager');$i++):?>
					<?php if($i != $pagerInfo['current']):?>
						<a class="btn" href="<?=$page_url.$i;?>"><?=$i;?></a>
					<?php else:?>
						<span class="mob_selected"><?=$i;?></span>
					<?php endif;?>
				<?php endfor; ?>
				.. <a class="<?php echo($pagerInfo['current']==$i)?'':'btn'?>" href="<?=$page_url.$pagerInfo['totalPages'];?>"><?=$pagerInfo['totalPages']?></a>
			<?php elseif($pagerInfo['current'] > ($pagerInfo['totalPages']- round(_cfg('mob_pager')/2)-1)):?>
				<a class="<?php echo($pagerInfo['current']==$i)?'':'btn'?>" href="<?=$page_url.'1';?>">1</a> ..
				<?php for($i = $pagerInfo['totalPages'] - _cfg('mob_pager')+1;$i <=$pagerInfo['totalPages'];$i++):?>
					<?php if($i != $pagerInfo['current']):?>
						<a class="btn" href="<?=$page_url.$i;?>"><?=$i;?></a>
					<?php else:?>
						<span class="mob_selected"><?=$i;?></span>
					<?php endif;?>
				<?php endfor; ?>
			<?php else:?>
				<a class="<?php echo($pagerInfo['current']==$i)?'':'btn'?>" href="<?=$page_url.'1';?>">1</a> ..
				<?php for($i = $pagerInfo['current'] - floor(_cfg('mob_pager')/2); $i <= ($pagerInfo['current'] + floor(_cfg('mob_pager')/2)); $i++):?>
					<?php if($i != $pagerInfo['current']):?>
						<a class="btn" href="<?=$page_url.$i;?>"><?=$i;?></a>
					<?php else:?>
						<span class="mob_selected"><?=$i;?></span>
					<?php endif;?>
				<?php endfor; ?>
				.. <a class="<?php echo($pagerInfo['current']==$i)?'':'btn'?>" href="<?=$page_url.$pagerInfo['totalPages'];?>"><?=$pagerInfo['totalPages']?></a>
			<?php endif;?>
			<?php if ($pagerInfo['nextUrl']): ?> <a class="btn" href="<?php echo $page_url.$pagerInfo['nextUrl'];?>">Вперед</a><?php endif;?>
		</div>
	</div>
</div>
<?php endif;?>